package com.yy.permissions_general.module.system.schedule.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yy.permissions_general.module.system.schedule.entity.ScheduleLog;
import com.yy.permissions_general.module.system.schedule.mapper.ScheduleLogMapper;
import com.yy.permissions_general.module.system.schedule.service.ScheduleLogService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 定时任务日志 服务实现类
 * </p>
 *
 * @author YY
 * @since 2022-02-09
 */
@Service
public class ScheduleLogServiceImpl extends ServiceImpl<ScheduleLogMapper, ScheduleLog> implements ScheduleLogService {

    /**
    * 分页查询列表
    * @param scheduleLog
    * @return
    */
    @Override
    public  Page<ScheduleLog>selectPageList(ScheduleLog scheduleLog, int limit, int page)  {
        Page pageContext = new Page(page,limit);
        Page<ScheduleLog> pageList = this.baseMapper.selectPage(pageContext, scheduleLog);
        return pageList;
    }

    /**
    * 新增数据
    * @param scheduleLog
    */
    @Override
    public int addScheduleLog(ScheduleLog scheduleLog) {
        return baseMapper.insert(scheduleLog);
    }
    /**
    * 删除数据
    * @param logId
    * @return
    */
    @Override
    public int deleteById(String logId) {
        return baseMapper.deleteById(logId);
    }

    /**
    * 批量删除
    * @param ids
    * @return
    */
    @Override
    public int deleteBatch(List<Long> ids) {
        return baseMapper.deleteBatchIds(ids);
    }

}

